﻿using System;
using System.Collections.Generic;
using System.Text;
using UnityEngine;
using Common;
using System.Reflection;


public class ActionConfig
{
    public static Dictionary<UInt16, ActionParameter> GetActionList(JobType job)
    {
        Dictionary<UInt16, ActionParameter> actionList = new Dictionary<UInt16, ActionParameter>();
        if (job == JobType.Soldier)
        {
            actionList[1] = new ActionParameter("Action_1", "Lianxuji01", true, 1);
            actionList[2] = new ActionParameter("Action_2", "Lianxuji02", true, 2);
            actionList[3] = new ActionParameter("Action_3", "Lianxuji03", true, 3);
            actionList[4] = new ActionParameter("Action_0", "Kongzhonggongji", false, 0);
            actionList[5] = new ActionParameter("Action_0", "Bisha", true, 0);
            actionList[6] = new ActionParameter("Action_0", "Chongcigongji", true, 0);
            actionList[7] = new ActionParameter("Action_0", "Shoushang", true, 0);
        }
        return actionList;
    }
    public static ActionBase GetAction(ActionParameter para)
    {
        ActionBase result = null;
        Type type = Type.GetType(para.AssName);
        if (type == null) throw new Exception("ActionConfig:GetAction(ActionParameter para) Can't find type:" + para.AssName);
        result = Activator.CreateInstance(Type.GetType(para.AssName)) as ActionBase;
        result.Parameter = para;
        return result;
    }
}
[Flags]
public enum JobType
{
    None = 0,
    Soldier,//战士
    Master //法师
}
[Flags]
public enum WeaponType
{
    None = 0,
    Knife,//刀
    Hammer//锤子
}
